import request from "@/utils/request";

// 分页部门查询
export function listPageDepartments(data) {
  return request({
    url: "/department/pages",
    method: "get",
    params: data,
  });
}

// 部门树查询
export function listTreeDepartments(data) {
  return request({
    url: "/department/tree",
    method: "get",
    params: data,
  });
}

// 新增部门
export function insertDepartment(data) {
  return request({
    url: "/department",
    method: "post",
    data,
  });
}

// 编辑部门
export function updateDepartment(data) {
  return request({
    url: "/department",
    method: "put",
    data,
  });
}

// 批量删除部门
export function deleteDepartments(data) {
  return request({
    url: "/department",
    method: "delete",
    params: data,
  });
}

// 删除部门
export function deleteDepartment(data) {
  return request({
    url: "/department/" + data,
    method: "delete",
  });
}
